#!/usr/bin/env python3
# -*- coding: utf-8 -*-


from flask import Blueprint,render_template, session
from ..database import Article
from ..utils import prettify
from ..secure import login_required

bp = Blueprint('index', __name__, url_prefix="/index")

@bp.route('/')
@bp.route("/<int:page>/")

def index(page=1):

    article_list = Article.query.paginate(page=page, per_page=10)
    
    url_for = "index.index"

    return render_template('/pages/index.html',
                            data=article_list,
                            url=url_for
                        )
    
